From: Jan D. Date: Fri, 3 Dec 2010 10:54:44 +0000 (+0100) Subject: Draw cursor and images correctly for Nextstep (bug#7412). X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~5475 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=2479788a57a1d1189df2c2b466af8784c2367619;p=emacs.git Draw cursor and images correctly for Nextstep (bug#7412). * src/nsterm.m (ns_dumpglyphs_image): If drawing cursor, fill background with cursor color and draw a rectangle around the image. --- diff --git a/src/ChangeLog b/src/ChangeLog index 52c88e470e4..c6852c1195d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-12-03 Jan Djärv + + * nsterm.m (ns_dumpglyphs_image): If drawing cursor, fill background + with cursor color and draw a rectangle around the image (Bug#7412). + 2010-12-03 Andreas Schwab * frame.c (x_set_font): Remove unused variable. diff --git a/src/nsterm.m b/src/nsterm.m index 128c9de86a0..78d690c020d 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2779,7 +2779,10 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r) else face = FACE_FROM_ID (s->f, s->first_glyph->face_id); - [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set]; + if (s->hl == DRAW_CURSOR) + [FRAME_CURSOR_COLOR (s->f) set]; + else + [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set]; if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin || s->img->mask || s->img->pixmap == 0 || s->width != s->background_width) @@ -2842,6 +2845,16 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r) s->slice.x == 0, s->slice.x + s->slice.width == s->img->width, s); } + + /* If there is no mask, the background won't be seen, + so draw a rectangle on the image for the cursor. + Do this for all images, getting trancparency right is not reliable. */ + if (s->hl == DRAW_CURSOR) + { + int thickness = abs (s->img->relief); + if (thickness == 0) thickness = 1; + ns_draw_box (br, thickness, FRAME_CURSOR_COLOR (s->f), 1, 1); + } }